import 'package:color_dart/RgbaColor.dart';
import 'package:flutter/cupertino.dart';

class TabTypeBtn extends StatelessWidget {
  final String title;
  final Function press;
  final bool active;

  TabTypeBtn({Key key, this.title, this.active, this.press}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: GestureDetector(
        onTap: () => press(),
        child: active
            ? Container(
                decoration: BoxDecoration(
                  shape: BoxShape.rectangle,
                  borderRadius: BorderRadius.all(Radius.circular(15)),
                  color: rgba(243, 247, 255, 1),
                ),
                child: Text(
                  title,
                  style: TextStyle(color: rgba(25, 109, 236, 1), fontSize: 12),
                ),
                padding:
                    EdgeInsets.only(left: 10, top: 6, right: 10, bottom: 6),
                margin: EdgeInsets.only(right: 10),
              )
            : Container(
                decoration: BoxDecoration(
                  shape: BoxShape.rectangle,
                  borderRadius: BorderRadius.all(Radius.circular(15)),
                  color: rgba(245, 245, 245, 1),
                ),
                child: Text(
                  title,
                  style: TextStyle(color: rgba(163, 163, 163, 1), fontSize: 12),
                ),
                padding:
                    EdgeInsets.only(left: 10, top: 6, right: 10, bottom: 6),
                margin: EdgeInsets.only(right: 10),
              ),
      ),
    );
  }
}
